home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UNIXTOOL / UNIXLIB37B / !UnixLib37_src_clib_h_pwd < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  2.1 KB  |  89 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/pwd,v $
  4.  * $Date: 1996/10/30 21:58:58 $
  5.  * $Revision: 1.2 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: pwd,v $
  10.  * Revision 1.2  1996/10/30 21:58:58  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.1  1996/04/19 21:02:57  simon
  14.  * Initial revision
  15.  *
  16.  ***************************************************************************/
  17.  
  18. /* POSIX Standard 9.2.2 User Database Access <pwd.h>.  */
  19.  
  20. #ifndef __PWD_H
  21. #define __PWD_H
  22.  
  23. #ifndef __UNIXLIB_TYPES_H
  24. #include <unixlib/types.h>
  25. #endif
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. struct passwd
  32. {
  33.   /* Username.  */
  34.   char    *pw_name;
  35.   /* Password.  */
  36.   char    *pw_passwd;
  37.   /* User ID.  */
  38.   __uid_t pw_uid;
  39.   /* Group ID.  */
  40.   __gid_t pw_gid;
  41.   /* Real name.  */
  42.   char    *pw_gecos;
  43.   /* Home directory.  */
  44.   char    *pw_dir;
  45.   /* Shell program.  */
  46.   char    *pw_shell;
  47. };
  48.  
  49. /* System V functions.  */
  50.  
  51. /* Rewind the password-file stream.  */
  52. extern void setpwent (void);
  53. /* Close the password-file stream.  */
  54. extern void endpwent (void);
  55. /* Read an entry from the password-file stream, opening it if necessary.  */
  56. extern struct passwd *getpwent (void);
  57. #ifdef FILE
  58. /* Read an entry from stream.  */
  59. extern struct passwd *fgetpwent (FILE *stream);
  60. extern int putpwent (const struct passwd *p, FILE *stream);
  61. #else
  62. extern struct passwd *fgetpwent (void *stream);
  63. extern int putpwent (const struct passwd *p, void *stream);
  64. #endif
  65.  
  66. /* POSIX functions.  */
  67.  
  68. /* Search for an entry with a matching user ID.  */
  69. extern struct passwd *getpwuid (__uid_t uid);
  70. /* Search for an entry with a matching username.  */
  71. extern struct passwd *getpwnam (const char *name);
  72.  
  73. /* Re-construct the password-file line for the given uid in the
  74.    given buffer.  */
  75. extern int getpw (__uid_t uid, char *buf);
  76.  
  77. /* UnixLib pwd implementation function.  */
  78. #ifdef FILE
  79. extern struct passwd *__pwdread (FILE *, struct passwd *);
  80. #else
  81. extern struct passwd *__pwdread (void *, struct passwd *);
  82. #endif
  83.  
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87.  
  88. #endif
  89.